<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of LoginPage
 *
 * @author juwking
 */
class LoginPage extends Controller {

    function __construct() {
        parent::__construct();
        $this->smarty->assign('title', 'Testowy Smarty');
    }

    function  getTemplate() {
        return 'login.tpl';
    }
    function login() {
        $userContext = UsersQuery::create()->filterByLogin($_REQUEST['login'])->filterByPassword($_REQUEST['password'])->find();

        $zalogowany = $userContext->getFirst();
        #var_dump($zalogowany);
        
        if (isset($zalogowany)) {
            $_SESSION['UserAccess'] = $zalogowany;
        }
        header("Location: index.php");
    }

}

?>
